package com.xiaoxin.nmzp.server.controller;

import com.ruoyi.common.core.domain.AjaxResult;
import com.xiaoxin.nmzp.server.entity.resp.CompanyResp;
import com.xiaoxin.nmzp.server.service.NmzpCompanyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/nmzp/company")
public class CompanyController {
    @Autowired
    private NmzpCompanyService nmzpCompanyService;

    /**
     * 根据ID获取公司信息以及旗下职位
     */
    @GetMapping("/{id}")
    public AjaxResult getCompanyById(@PathVariable("id") Long companyId){
        CompanyResp companyResp = nmzpCompanyService.getCompanyAndJobsById(companyId);
        return AjaxResult.success(companyResp);
    }

}
